<?php
$front = Zend_Controller_Front::getInstance()->getRequest();
$action = "/" . $front->getModuleName() . "/" . $front->getControllerName() ;
?>
<script type="text/javascript" >
    function confirmDelete( id, locked ) {
        var accion = 'eliminar';
        if( locked == 'T' ) {
            accion = 'recuperar';
        }
        Sexy.confirm('Esta segur@ que quiere ' + accion + ' este registro?', {onComplete:
                function(returnvalue) {
                if(returnvalue) {
                    Sexy.info('Registro eliminado con exito');
                    location.href= "<?=$action?>/delete/id/" + id;
                } else{
                    return false;
                }
            }
        });
    }
</script>

<h1>Cuentas</h1>
<div class="module">
<?php if (count($this->paginator)): ?>
<br/>
    <?php echo $this->paginator ?>
<br/>


    <h2><span>Usuarios</span></h2>

    <div class="module-table-body">
        <table id="myTable" class="tablesorter">
            <thead>
                <tr>
                    <th class="header">Id</th>
                    <th class="header">Username</th>
                    <th class="header">Rol</th>
                    <th class="header">&nbsp;</th>
                </tr>
            </thead>
            <tbody>
                <?php $i=0;foreach ($this->paginator as $node) : ?>
                <tr class=<?php echo ($i%2==0?'"even"':'"odd"') ?>>
                    <td><?=$node['user_id'] ?></td>
                    <td><a href="/accounts/update/id/<?=$node['user_id']?>/"><?=$node['username'] ?></a></td>
                    <td>&nbsp;</td>
                    <td>
						<a href="/accounts/update/id/<?=$node['user_id']?>/"><img width="16" height="16" alt="edit" src="/imgs/pencil.gif"></a>
                        <a href="/accounts/delete/id/<?=$node['user_id']?>/"><img width="16" height="16" alt="edit" src="/imgs/cross.gif"></a>
                    </td>
                </tr>
        <?php $i++;  endforeach;?>

            </tbody>
        </table>
    </div>
    <?php echo $this->paginator ?>

<?php endif;?>
</div> <!-- End .module -->
